from collections import defaultdict

n = int(input())
nums = list(map(int, input().split()))
prefix = [0]
for num in nums:
    prefix.append(num ^ prefix[-1])

def weight(num):
    cnt = 0
    while num:
        num &= (num - 1)
        cnt += 1
    return cnt
pop_count = [weight(num) % 2 for num in prefix]
h = [0,0]
ans = 0
for p in pop_count:
    if p:
        ans += h[0]
    else:
        ans += h[1]
    h[p] += 1
print(ans)